<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function arr(s) {
      const set = new Set(['a', 'e', 'i', 'o', 'u'])
      const mid = s.length / 2
      let cnt1 = cnt2 = 0
      for (let i = 0; i < mid; i++) {
        //转换小写
        if (set.has(s[i].toLowerCase())) cnt1++
        if (set.has(s[mid + i].toLowerCase())) cnt2++
      }
      return cnt1 === cnt2
    };
    console.log(arr("book"));
  </script>
</body>

</html>